Move EraBasedProtocolParametersUpdate to Cardano.Api.Compatible.ProtocolParametersUpdate - #1336
Merged
Merged
Conversation
Jimbo4350
requested review from
CarlosLopezDeLara,
carbolymer,
disassembler,
erikd and
palas
as code owners
September 10, 2026 16:49
Jimbo4350
force-pushed
the
jordan/move-era-based-pparams-update
branch
from
September 10, 2026 16:49
a4fad03 to
302fc0d
Compare
| {-# LANGUAGE ConstraintKinds #-} | ||
| {-# LANGUAGE DataKinds #-} | ||
| {-# LANGUAGE DeriveAnyClass #-} | ||
| {-# LANGUAGE DeriveDataTypeable #-} |
| {-# LANGUAGE DataKinds #-} | ||
| {-# LANGUAGE DeriveAnyClass #-} | ||
| {-# LANGUAGE DeriveDataTypeable #-} | ||
| {-# LANGUAGE DeriveGeneric #-} |
| {-# LANGUAGE FlexibleContexts #-} | ||
| {-# LANGUAGE FlexibleInstances #-} | ||
| {-# LANGUAGE GADTs #-} | ||
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} |
| {-# LANGUAGE FlexibleInstances #-} | ||
| {-# LANGUAGE GADTs #-} | ||
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
| {-# LANGUAGE LambdaCase #-} |
| {-# LANGUAGE GADTs #-} | ||
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
| {-# LANGUAGE LambdaCase #-} | ||
| {-# LANGUAGE NamedFieldPuns #-} |
Jimbo4350
force-pushed
the
jordan/move-era-based-pparams-update
branch
from
September 10, 2026 17:58
302fc0d to
1f1acd6
Compare
Base automatically changed from
jordan/remove-protocol-parameters
to
master
September 10, 2026 18:37
palas
approved these changes
Sep 11, 2026
palas
left a comment
Contributor
There was a problem hiding this comment.
Looks good 👍. (Just code moving from one module to another.)
One question
Comment on lines
+46
to
+47
| -- * Data family instances | ||
| , AsType (..) |
Contributor
There was a problem hiding this comment.
Suggested change
| -- * Data family instances | |
| , AsType (..) | |
| -- * Data family instances | |
| , AsType (AsUpdateProposal) |
Should we qualify this export? Apparently, it will export things like AsPaymentKey, AsWord8, and AsByteStringLazy, if we don't qualify it
…colParametersUpdate Relocates the era-based protocol parameter update GADT, its era-sliced record types, createEraBasedProtocolParamUpdate, createPParams and the pre-Conway UpdateProposal machinery into a new Compatible module. The UpdateProposal cluster has to move with the GADT: UpdateProposal contains it, and its FromCBOR instance depends on fromLedgerPParamsUpdate, which in turn uses the private pparamsUpdateTo* helpers. Cardano.Api.ProtocolParameters re-exports the new module, so its export list and Cardano.Api are unchanged. Cardano.Api.Compatible re-exports the new module as well.
AsType (..) on a data family re-exports every in-scope instance constructor, not just the one defined in this module.
Jimbo4350
force-pushed
the
jordan/move-era-based-pparams-update
branch
from
September 11, 2026 15:57
fa282fb to
74cd35b
Compare
Jimbo4350
enabled auto-merge
September 11, 2026 15:59
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified, and existing exports are preserved.
Pull request overview
Moves era-based protocol parameter update machinery into a dedicated compatibility module while preserving existing exports.
Changes:
- Added and re-exported
ProtocolParametersUpdate. - Registered the new module in Cabal.
- Added a refactoring changelog entry.
File summaries
| File | Description |
|---|---|
cardano-api/src/Cardano/Api/ProtocolParameters.hs |
Re-exports the moved definitions. |
cardano-api/src/Cardano/Api/Compatible/ProtocolParametersUpdate.hs |
Contains the moved update machinery. |
cardano-api/src/Cardano/Api/Compatible.hs |
Re-exports the new module. |
cardano-api/cardano-api.cabal |
Exposes the new module. |
.changes/move-era-based-protocol-parameters-update.yml |
Documents the refactoring. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
Context
Follow-up to #1335 (stacked on it). Moves the era-based update-proposal machinery out of
Cardano.Api.ProtocolParametersintoCardano.Api.Compatible.ProtocolParametersUpdate:EraBasedProtocolParametersUpdate, its era-sliced records,createEraBasedProtocolParamUpdate,createPParams,UpdateProposaland itsto/fromLedger*conversions. TheUpdateProposalcluster must move with the GADT: it contains it, and the GADT'sFromCBORinstance depends onfromLedgerPParamsUpdate, which uses the private slice helpers.Cardano.Api.ProtocolParametersre-exports the new module, so its export list andCardano.Apiare unchanged.Cardano.Api.Compatiblere-exports it too.How to trust this PR
Cardano.Api.ProtocolParametersis identical to master.cabal build cardano-api --enable-testsis clean under-Werror.Checklist
🤖 Generated with Claude Code